package org.ee.system.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.ee.core.api.Result;
import org.ee.system.service.MenuService;
import org.ee.system.vo.MenuVo;
import org.ee.system.vo.RouteRecord;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 菜单数据接口
 *
 * @Author zlj
 * @Date 2025/8/31 23:17
 */
@RestController
@RequestMapping("/menu")
@Tag(name = "菜单管理", description = "菜单管理模块")
public class MenuController {

    private final MenuService menuService;

    public MenuController(MenuService menuService) {
        this.menuService = menuService;
    }

    @GetMapping("/tree")
    @Operation(summary = "获取菜单树")
    public Result<List<RouteRecord>> getMenusTree() {
        return Result.success(menuService.getMenuTree());
    }
}
